#pragma once

/*
 * NOTE! This ctype does not handle EOF like the standard C
 * library is required to.
 */

#define _U 0x01  /* upper */
#define _L 0x02  /* lower */
#define _D 0x04  /* digit */
#define _C 0x08  /* cntrl */
#define _P 0x10  /* punct */
#define _S 0x20  /* white space (space/lf/tab) */
#define _X 0x40  /* hex digit */
#define _SP 0x80 /* hard space (0x20) */

static inline int _isdigit(int c)
{
    return '0' <= c && c <= '9';
}

unsigned char __ismask(unsigned char c);

#define isalnum(c) ((__ismask(c) & (_U | _L | _D)) != 0)
